<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>系统查看</title>
    <link href="css/index.css" rel="stylesheet" type="text/css"/>
    <style>
        #quit {
            color: blue;
        }

        #quit:hover {
            cursor: pointer;
            color: #F4A460;
        }
    </style>
</head>
<body>
<div>
    <div id="top">
        <p class="title">&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="index.jsp" style="cursor:pointer;">HappyMusic后台系统</a>
        </p>
        <p class="quit">&nbsp;<a href="login.html" onclick="return confirm('确认退出吗? ');quit()" id="quit">退出</a>&nbsp;&nbsp;&nbsp;
        </p>
        <p class="welcome">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;欢迎你&nbsp;<%=session.getAttribute("username")%>&nbsp;&nbsp;&nbsp;</p>
        <p id="showTime" class="showTime">&nbsp;&nbsp;</p>
    </div>
    <div id="left">

        <div class="rad"><a href="admin">系统设置</a></div>
        <div class="rad"><a href="myUser">用户管理</a></div>
        <div class="rad"><a href="mySong">歌曲管理</a></div>
        <div class="rad"><a href="myList">歌单管理</a></div>
    </div
    <div id="right">
        <h2 style="color:blue;">welcome</h2>
        <table style="font-size:22px;">
            <tr>
                <td>用户总数:<%=request.getAttribute("userCount")%>
                </td>
            </tr>
            <tr>
                <td>歌曲总数:<%=request.getAttribute("songCount")%>
                </td>
            </tr>
            <tr>
                <td>歌单总数:<%=request.getAttribute("songListCount")%>
                </td>
            </tr>
    </div>
    <div id="bottom">版权所有</div>
</div>
<script>
    function showTime() {
        var a = new Date();
        var b = a.toLocaleTimeString();
        var c = a.toLocaleDateString();
        document.getElementById("showTime").innerHTML = c + "&nbsp" + b;
    }

    setInterval(function () {
        showTime()
    }, 1000);

    function quit() {
        //防止页面后退
        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });
    }
</script>
</body>
</html>
